package com.heima.feign;

import com.heima.dto.WmNews;
import com.heima.dto.WmNewsPageVO;
import com.heima.model.admin.dtos.NewsAuthDto;
import com.heima.model.media.dtos.WmUserDto;
import com.heima.model.wemedia.dto.WmNewsPageDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "leadnews-wemedia")
public interface WmUserFeignClient {

    @PostMapping("/api/v1/wmuser/save")
    Integer createUser(@RequestBody WmUserDto dto);

    /**
     * feign调用文章列表查询
     *
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/news/list")
    List<WmNewsPageVO> authList(@RequestBody WmNewsPageDTO dto);

    /**
     * feign调用自媒体文章审核通过
     *
     * @param newsId
     * @return
     */
    @PostMapping("/api/v1/news/auth_pass")
    WmNews authPass(@RequestParam("id") Integer newsId);

    /**
     * feign调用文章人工审核失败
     */
    @PostMapping("/api/v1/news_auth/auth_fail")
    void authFail(@RequestBody NewsAuthDto dto);
}
